package com.example.administrator.yunniuusedcar.adapter.Search_SortingAdapter;

import android.content.Context;
import android.widget.ImageView;

import com.example.administrator.yunniuusedcar.R;
import com.example.administrator.yunniuusedcar.holder.ZgEquatorCar_ZongHe_Bean;
import com.squareup.picasso.Picasso;
import com.zhy.adapter.recyclerview.CommonAdapter;
import com.zhy.adapter.recyclerview.base.ViewHolder;

import java.util.List;

/**  中规豪车  综合排序 type1 ；适配器
 * Created by Administrator on 2017/12/20.
 */

public class ZgZongHe_CategoryAdapter extends CommonAdapter<ZgEquatorCar_ZongHe_Bean.Data> {

    public ZgZongHe_CategoryAdapter(Context context, int layoutId, List<ZgEquatorCar_ZongHe_Bean.Data> datas) {
        super(context, layoutId, datas);
    }

    @Override
    protected void convert(ViewHolder holder, ZgEquatorCar_ZongHe_Bean.Data data, int position) {

        Picasso.with(holder.itemView.getContext()).load(data.logo).into((ImageView) holder.getView(R.id.iv_home_carPage)); // 标题图片

        holder.setText(R.id.tv_home_catInfo,data.name)    // 标题
                .setText(R.id.tv_home_carPay,("付款：")+data.sale)  // 付款
                .setText(R.id.tv_ZG_carYhMoney,data.integral_range)    // 优惠价格
                .setText(R.id.item_home_carSCsave,"收藏："+ data.collection_num)   // 收藏量
                .setText(R.id.tv_home_carMoney,data.market_price);    // 市场价格



    }
}
